/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tabela;

import classe.Conta;
import java.util.ArrayList;
import java.util.List;
import javax.swing.table.AbstractTableModel;


/**
 *
 * @author GEMADA
 */
public class TabelaModelo extends AbstractTableModel  {

    List<Conta> listaConta = new ArrayList<>();
    
    public TabelaModelo(List<Conta> listaConta){
        this.listaConta = listaConta;
    }
    
    @Override
    public int getRowCount() {
        int w = 1;
        return w;
    }

    @Override
    public int getColumnCount() {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override  
    public Object getValueAt(int rowIndex, int columnIndex) {  
            Conta cliente = listaConta.get(rowIndex);   
        
            switch (columnIndex) {  
            case 0:  
                return cliente.getCnpj();  
            case 1:  
                return cliente.getContribuinte();  
            case 2:  
                return cliente.getUsuario();  
            default:  
                throw new IndexOutOfBoundsException("columnIndex out of bounds");  
        }  
    }  
    
}
